<extend name="common/base" />
<block name="resource">
    <link rel="stylesheet" href="__PUBLIC__/Home/ui3/css/leftCommon.css?v=1.0.1">
    <link rel="stylesheet" href="__PUBLIC__/Home/ui3/css/game.css"/>

    <script src="__PUBLIC__/Home/ui3/js/web/paging.js" type="text/javascript"></script>
    <script src="__PUBLIC__/Home/ui3/js/web/scroll.js?v=1.0" type="text/javascript"></script>
    <script src="__PUBLIC__/Home/ui3/js/web/home/user.js?v=1.0" type="text/javascript"></script>
    <script src="__PUBLIC__/Home/ui3/js/web/home/recommend.js?v=1.0" type="text/javascript"></script>
    <script src="__PUBLIC__/Home/ui3/js/web/home/games.js"></script>
</block>

<block name="content">
    <div class="main">
        <div class="container">
            <include file="Ucenter/left" />
            <div class="main-right">
                <div class="game-title">关注游戏设置</div>
                    <div class="followed-game">
                        <div class="followed-title">
                            <span>已关注游戏</span>
                        </div>
                        <div class="followed-list" data-bind="foreach:gameList">
                            <!-- ko if:is_scribe() -->
                            <div class="followed-item">
                                <div class="item-pic">
                                    <img src="" alt="" data-bind="attr:{'src':cover, 'alt':name}"/>
                                    <div class="shadow">
                                        <input class="att-game btn myBtn" type="button" value="取消关注" data-bind="click:click"/>
                                    </div>
                                </div>
                                <div class="item-name" data-bind="text:name"></div>
                            </div>
                            <!-- /ko -->
                        </div>
                    </div>
                    <div class="unfollowed-game">
                        <div class="followed-title">
                            <span>未关注游戏</span>
                        </div>
                        <div class="followed-list"  data-bind="foreach:gameList">
                            <!-- ko if:!is_scribe() -->
                            <div class="followed-item">
                                <div class="item-pic">
                                    <img src="" alt="" data-bind="attr:{'src':cover, 'alt':name}"/>
                                    <div class="shadow">
                                        <input type="button" value="关注" class="unatt-game btn myBtn" data-bind="click:click"/>
                                    </div>
                                </div>
                                <div class="item-name" data-bind="text:name"></div>
                            </div>
                            <!-- /ko -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="backTop" id="backTop" title="返回顶部">
            <a href="javascript:;"></a>
        </div>
    </div>
</block>

<block name="init">
    <script type="text/javascript">
        window._THIS = {
            videoLink : "/video-",
            matchLink : "/match-detail-",
            recommendUrl : "{:U('Visitor/dailyRecommend')}",
            scribeUrl : {
                doScribe : "{:U('api/scribe/scribe')}",
                unScribe : "{:U('api/scribe/unscribe')}",
            },
        };
        function dataInit() {
            var user = {$user|json_encode};
            viewModel.user(getUser(user));
            viewModel.self({
                'id' : user.id,
                'avatar' : user.avatar ? user.avatar : _COMMON.DEFAULT_AVATAR,
                'nickname' : user.nickname,
            });

            var recommend = {$hotVideo|json_encode};
            viewModel.recommendList(getRecommend(recommend));

            var gameList = {$gameList|json_encode};
            viewModel.gameList(getGames(gameList));
        }
    </script>
</block>